<?php

namespace Controller\Article;

class Goadd extends \Controller\Base {

    public function actionIndex() {
        $this->setMenuPath('Article', 'Lists');
        $pid = $this->getInt('pid');
        $url = '/Article/Add?pid=' . $pid;
        if ($pid) {
            $articleId = \Business\Article::instance()->getArticleIdByCategoryId($pid);
            $url .= '&id=' . $articleId;
        }
        \Lib\Util\Comm::instance()->redirect($url);
    }

}